allcourses=[['CH111', 'CH112', 'EL112', 'HU111', 'LS111', 'LS112', 'MA111', 'PH111', 'PH112'], ['CH211', 'CH212', 'ES211', 'LS211', 'LS212', 'MA211', 'PH211', 'PH212'], ['CH311', 'CH312', 'CH313', 'CH314', 'CH315', 'ES311', 'ES312', 'ES313', 'ES314', 'ES315', 'LS311', 'LS312', 'LS313', 'LS314', 'LS315', 'MA311', 'MA312', 'MA313', 'MA314', 'MA315', 'PH311', 'PH312', 'PH313', 'PH314', 'PH315'], ['CH411', 'CH412', 'CH414', 'ES411', 'ES412', 'ES413', 'ID411', 'ID412', 'ID413', 'ID414', 'ID415', 'ID416', 'ID417', 'ID418', 'ID419', 'ID431', 'ID432', 'ID433', 'ID434', 'ID435', 'LS411', 'LS412', 'LS413', 'LS414', 'MA411', 'MA412', 'MA413', 'PH411', 'PH412', 'PH413', 'PH414', 'SM411'], ['CH511', 'CH512', 'ES511', 'ES512', 'ES513', 'LS511', 'LS512', 'MA511', 'MA512', 'MA513', 'MA514', 'MA515', 'PH511', 'PH512', 'PH513', 'PH514', 'PH515']]

basic=r"""
<!DOCTYPE html>
<html>
	<head>
		<title>IISERK - Postman</title>
		<meta http-equiv="content-type" content="text/html; charset=utf-8" />
		<link href="/style.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="/js/script.js"></script>
	</head>

<body>
	
<div id="header">
	<div id="heading"><h1>IISERK - Postman</h1></div>
	<div id="logo"><a href="/"><img src="header-small.png"/></a></div>
</div>

<div id="content">
	<h2>Introducing IISER-K Postman</h2>
		<div id="info">
			<p>
			This is a web app meant to simplify the task of communicating course related information to all the students attending a specific course via e-mail. Something we all have to do from time to time, I guess. 
			</p>
			<p>
			<h2>Here's how it works:</h2>
			<ol>
				<li>You choose which courses you are attending curently (At this page).</li>
				<li>Somebody sends a mail to <a href="mailto:postman@iiserk.net">postman@iiserk.net</a> mentioning the couse ID (e.g. &quot;MA324&quot;) in the subject.</li>
				<li>It is automatically delivered to your e-mail address.</li>
			</ol>
			</p>
		</div>

		<h2>Select your courses</h2><br>
		%s
	</div>
	<br><br>
</body>
</html>

"""

forms="""
You are now logged in as %s, if you want to receive the mails at some other address, please <a href="%s">logout</a>.<br>
	<div id="form" onclick="my_whichElement(event)">
			<form method="POST" action="/register" >
				<div style="padding:0;float:left;position:relative;width:20%%;margin:0"  >
					<a><h5>1st Year</h5></a>
					<div class="subsec">
						%s
					</div>
				</div>
				<div style="padding:0;float:left;position:relative;width:20%%;margin:0"  >
					<a><h5>2nd Year</h5></a>
					<div class="subsec">
						%s
					</div>
				</div>	
				<div style="padding:0;float:left;position:relative;width:20%%;margin:0"  >
					<a><h5>3rd Year</h5></a>
					<div class="subsec">
						%s
					</div>
				</div>
				<div style="padding:0;float:left;position:relative;width:20%%;margin:0"  >
					<a><h5>4th Year</h5></a>
					<div class="subsec">
						%s
					</div>
				</div>

				<div style="padding:0;float:left;position:relative;width:20%%;margin:0"  >
					<a><h5>5th Year</h5></a>
					<div class="subsec">
						%s
					</div>
				</div>

				<div style="text-align:center;padding:10px;clear:both">
					<br>
					<input type="submit" name="submit" value="submit"></input><br>
				</div>

			</form>
		</div>

"""

full=basic%forms

openid_box="""
<div id="auth_select">
	In order to select your courses, you have to sign-in with any of these:<br>
	<br><br>
	<!-- 
	Lifted from the openid-selector demo page
	-->

	<link rel="stylesheet" href="css/openid.css" />
	<script type="text/javascript" src="js/jquery-1.2.6.min.js"></script>
	<script type="text/javascript" src="js/openid-jquery.js"></script>
	<script type="text/javascript" src="js/openid-jquery-en.js"></script>
	<script type="text/javascript">
	$(document).ready(function() {
	    openid.init('openid_identifier');
	});
	</script>
	<!-- /Simple OpenID Selector -->
	
	<style type="text/css">
		/* Basic page formatting. */
		body {
			font-family:"Helvetica Neue", Helvetica, Arial, sans-serif;
		}
	</style>
</head>

<body>

<!-- Simple OpenID Selector -->
<form action="/handler" method="POST" id="openid_form">
	<input type="hidden" name="action" value="verify" />

	<fieldset>
    		<legend>Sign-in or Create New Account</legend>
    		
    		<div id="openid_choice">
	    		<p>Please click your account provider:</p>
	    		<div id="openid_btns"></div>
			</div>
			
			<div id="openid_input_area">
				<input id="openid_identifier" name="openid_identifier" type="text" value="http://" />
				<input id="openid_submit" type="submit" value="Sign-In"/>
			</div>
			<noscript>
			<p>OpenID is service that allows you to log-on to many different websites using a single indentity.
			Find out <a href="http://openid.net/what/">more about OpenID</a> and <a href="http://openid.net/get/">how to get an OpenID enabled account</a>.</p>
			</noscript>
		</fieldset>

		<div>
	</div>
</form>
<h5>openid-selector courtesy of  <a href="http://code.google.com/p/openid-selector/">http://code.google.com/p/openid-selector</a></h5>

</div>
"""
